<?php echo $this->element("admin_header"); ?>
<?php //debug($this->data)?>
<div class="posts form">
<?php echo $form->create('Post');?>
	<fieldset>
 		<legend><?php __('Edit Post');?></legend>
	<?php
		echo $form->input('id');
		
		echo $form->input('title');
		echo $form->input('body', array('rows'=>'25'));
		echo $form->input('date');
		echo $form->input('published');
		
		
	?>
	
	</fieldset>
		<fieldset class="category sidebar">
	 		<legend><?php __('Post category');?></legend>
			<?php echo $form->input('Category'); ?>
		</fieldset>
		<fieldset class="images sidebar">
	 		<legend><?php __('Embed images');?></legend>
			<?php echo $form->input('Image'); ?>
			<?php if (!empty($post['Image'])):?>
				<?php foreach ($post['Image'] as $image):?>
					<div class="image">
						<strong><?php echo $image['title'];?> <span>[image:<?php echo $image['id']?> size:full]</span></strong>
						<?php echo $gershImage->resize($image['dir'] . DS . $image['filename'], "thumb", array('title'=>$image['title'], 'alt'=>$post['Image'][0]['title'])); ?>
					</div>
				<?php endforeach; ?>
				<p class="help"><?php echo Configure::read('Image.embedimagehelp'); ?></p>
			<?php endif; ?>
		</fieldset>
	<?php echo $form->end('Submit', array('value'=>'Save post'));?>
</div>


